Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the Touch ID credential picker #14493

Merged
merged 7 commits into from
Jul 19, 2022

Conversation

codingllama
Copy link
Contributor

Implement the Touch ID credential picker.

During passwordless authentication, when more than one login is present in Enclave credentials, tsh now asks the end user to pick their desired login. Credential picker terminal prompts are preceded by a system Touch ID prompt, which is then reused for authentication, provided less than 10 seconds pass in the meantime.

I've done a couple of refactors to make the CredentialInfo structs similar between the webauthncli and touchid packages, so it's easier to trace parallels between them.

#13901

@codingllama
Copy link
Contributor Author

Branched from #14492, target changes to master automatically once the base is merged.

I suggest reviewing commit-by-commit, as the first few commits are just refactoring and moving a few types around.

@codingllama
Copy link
Contributor Author

Example UX:

$ tsh login --proxy=zarquon --auth=passwordless
> Using platform authenticator, follow the OS prompt
(touches sensor)
> [1] wan1
> [2] wan2
> [3] wan3
> Choose the user for login: wan2
(logged in)

@codingllama codingllama force-pushed the codingllama/touchid-guard branch from e26cf95 to def5b95 Compare July 14, 2022 21:09
@codingllama codingllama force-pushed the codingllama/touchid-picker2 branch from a60d82d to 546716a Compare July 14, 2022 21:09
@codingllama codingllama force-pushed the codingllama/touchid-guard branch from def5b95 to 0f0e7d2 Compare July 15, 2022 14:42
@codingllama codingllama force-pushed the codingllama/touchid-picker2 branch from 546716a to 82516e7 Compare July 15, 2022 14:43
lib/auth/touchid/api.go Show resolved Hide resolved
lib/auth/touchid/api.go Show resolved Hide resolved
lib/auth/touchid/api_test.go Show resolved Hide resolved
lib/auth/touchid/api_test.go Show resolved Hide resolved
lib/auth/webauthncli/prompt.go Show resolved Hide resolved
@codingllama codingllama force-pushed the codingllama/touchid-guard branch from 0f0e7d2 to 7ab54c5 Compare July 18, 2022 14:29
@codingllama codingllama force-pushed the codingllama/touchid-picker2 branch from 82516e7 to 8869cc8 Compare July 18, 2022 14:41
@codingllama
Copy link
Contributor Author

Thanks, Edoardo!

lib/auth/touchid/api.go Show resolved Hide resolved
@codingllama codingllama force-pushed the codingllama/touchid-guard branch from 7ab54c5 to 098cc74 Compare July 18, 2022 16:29
@codingllama codingllama force-pushed the codingllama/touchid-picker2 branch from 8869cc8 to 03aa7cb Compare July 18, 2022 16:31
@codingllama codingllama force-pushed the codingllama/touchid-guard branch from 098cc74 to 642d112 Compare July 18, 2022 17:08
@codingllama codingllama force-pushed the codingllama/touchid-picker2 branch from 03aa7cb to 07f3618 Compare July 18, 2022 17:14
@codingllama
Copy link
Contributor Author

Thanks, folks.

@espadolini PTAL?

@codingllama codingllama force-pushed the codingllama/touchid-guard branch 3 times, most recently from bee523a to 055aea4 Compare July 18, 2022 21:05
Base automatically changed from codingllama/touchid-guard to master July 18, 2022 22:28
@codingllama codingllama force-pushed the codingllama/touchid-picker2 branch from 07f3618 to baef09b Compare July 18, 2022 22:30
@codingllama codingllama enabled auto-merge (squash) July 18, 2022 22:30
@codingllama codingllama force-pushed the codingllama/touchid-picker2 branch from baef09b to a43f14a Compare July 19, 2022 13:50
@codingllama codingllama force-pushed the codingllama/touchid-picker2 branch from a43f14a to 2112a12 Compare July 19, 2022 14:10
@codingllama codingllama merged commit f93e68e into master Jul 19, 2022
@codingllama codingllama deleted the codingllama/touchid-picker2 branch July 19, 2022 16:20
codingllama added a commit that referenced this pull request Jul 19, 2022
Implement the Touch ID credential picker.

During passwordless authentication, when more than one login is present in
Enclave credentials, `tsh` now asks the end user to pick their desired login.
Credential picker terminal prompts are preceded by a system Touch ID prompt,
which is then reused for authentication, provided less than 10 seconds pass in
the meantime.

I've done a couple of refactors to make the `CredentialInfo` structs similar
between the `webauthncli` and `touchid` packages, so it's easier to trace
parallels between them.

#13901

* Refactor touchid.CredentialInfo
* Refactor wancli.CredentialInfo
* Move fido2_prompt*.go to prompt*.go
* Define the touchid credential picker API
* Add Touch ID credential picker tests
* Implement touchid credential picker
codingllama added a commit that referenced this pull request Jul 19, 2022
Implement the Touch ID credential picker.

During passwordless authentication, when more than one login is present in
Enclave credentials, `tsh` now asks the end user to pick their desired login.
Credential picker terminal prompts are preceded by a system Touch ID prompt,
which is then reused for authentication, provided less than 10 seconds pass in
the meantime.

I've done a couple of refactors to make the `CredentialInfo` structs similar
between the `webauthncli` and `touchid` packages, so it's easier to trace
parallels between them.

To avoid double-prompting users during Touch ID authentication we have to set a
grace period in the underlying LAContext and share it between the functions.
Note that AuthContextGuard (native) uses the LAContext explicitly, whereas
Authenticate (native) uses it through the SecItemCopyMatching query dictionary.

#14493:

* Refactor touchid.CredentialInfo
* Refactor wancli.CredentialInfo
* Move fido2_prompt*.go to prompt*.go
* Define the touchid credential picker API
* Add Touch ID credential picker tests
* Implement touchid credential picker

#13901:

* Allow explicit Touch ID prompts

Backports #14492 and #14493.

Closes #13901.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants